package com.ruoyi.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.KeyBasketMapper;
import com.ruoyi.system.domain.KeyBasket;
import com.ruoyi.system.service.IKeyBasketService;

/**
 * 篮子Service业务层处理
 *
 * @author 蒼飞
 * @date 2025-02-18
 */
@Service
public class KeyBasketServiceImpl implements IKeyBasketService {
    @Autowired
    private KeyBasketMapper keyBasketMapper;


    /**
     * 查询篮子
     *
     * @param id 篮子主键
     * @return 篮子
     */
    @Override
    public KeyBasket selectKeyBasketById(Long id) {
        return keyBasketMapper.selectKeyBasketById(id);
    }

    /**
     * 查询篮子列表
     *
     * @param keyBasket 篮子
     * @return 篮子
     */
    @Override
    public List<KeyBasket> selectKeyBasketList(KeyBasket keyBasket) {
        return keyBasketMapper.selectKeyBasketList(keyBasket);
    }

    /**
     * 新增篮子
     *
     * @param keyBasket 篮子
     * @return 结果
     */
    @Override
    public int insertKeyBasket(KeyBasket keyBasket) {
        return keyBasketMapper.insertKeyBasket(keyBasket);
    }

    /**
     * 修改篮子
     *
     * @param keyBasket 篮子
     * @return 结果
     */
    @Override
    public int updateKeyBasket(KeyBasket keyBasket) {
        return keyBasketMapper.updateKeyBasket(keyBasket);
    }

    /**
     * 批量删除篮子
     *
     * @param ids 需要删除的篮子主键
     * @return 结果
     */
    @Override
    public int deleteKeyBasketByIds(Long[] ids) {
        return keyBasketMapper.deleteKeyBasketByIds(ids);
    }

    /**
     * 删除篮子信息
     *
     * @param id 篮子主键
     * @return 结果
     */
    @Override
    public int deleteKeyBasketById(Long id) {
        return keyBasketMapper.deleteKeyBasketById(id);
    }


    /**
     * 去找用in去找是否已经有父类
     *
     * @param process
     * @return
     */
    @Override
    public List<KeyBasket> selectKeyBasket(List<String> process) {
        return keyBasketMapper.selectKeyBasket(process);
    }

    /**
     * 批量插入
     * @param cha
     */
    @Override
    public void insertBatch(List<KeyBasket> cha) {
        keyBasketMapper.insertBatch(cha);
    }

    /**
     * 根据key来查询basket
     * @param key1
     * @return
     */
    @Override
    public KeyBasket selectByKey(String key1) {
        return keyBasketMapper.selectByKey(key1);
    }
}
